<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <input type="text" class="inp1" />
    <select name="" id="">
      <option>+</option>
      <option>-</option>
      <option>*</option>
      <option>/</option>
    </select>
    <input type="text" class="inp2" />
    <button class="btn">运算</button>
    <input type="text" class="inp3" />
    <script>
      let inp1 = document.querySelector(".inp1");
      let inp2 = document.querySelector(".inp2");
      let select = document.querySelector("select");
      let inp3 = document.querySelector(".inp3");
      let btn = document.querySelector(".btn");
      btn.onclick = function () {
        if (inp1.value.trim() === "" || inp2.value.trim() === "")
          return alert("请输入内容");
        if (isNaN(inp1.value) || isNaN(inp2.value))
          return alert("请输入数字格式");
        let str = "";
        for (let i = inp1.value; i <= inp2.value; i++) {
          let g = i % 10;
          let s = parseInt(i / 10) % 10;
          let b = parseInt(i / 100);
          if (g ** 3 + s ** 3 + b ** 3 == i) {
            str += i + "";
          }
        }
        inp3.value = str;
      };
    </script>
  </body>
</html>
